package com.sky.service.impl;

import com.sky.entity.SetmealDish;
import com.sky.mapper.SetmealDishMapper;
import com.sky.service.SetmealDishService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SetmealDishServiceImpl implements SetmealDishService {
    @Autowired
    private SetmealDishMapper setmealDishMapper;

    @Override
    public List<SetmealDish> findBySetmealId(Long id) {
      List<SetmealDish> setmealDishes =  setmealDishMapper.findBySetmealId(id);
        return setmealDishes;
    }

    @Override
    public Integer findByDishIds(List<Long> ids) {
      Integer count = setmealDishMapper.findByDishIds(ids);
        return count;
    }

    @Override
    public void save(List<SetmealDish> setmealDishes) {
        setmealDishMapper.save(setmealDishes);
    }

    @Override
    public void deleteBySetmealId(Long id) {
        setmealDishMapper.deleteBySetmealId(id);
    }



    @Override
    public List<Long> findByDishId(Long id) {
        List<Long> ids = setmealDishMapper.findByDishId(id);
        return ids;

    }
}
